﻿<UserControl x:Class="GraphicsDesigner.ucModel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:t="clr-namespace:HelixToolkit;assembly=HelixToolkit" 
             mc:Ignorable="d" 
             d:DesignHeight="586" d:DesignWidth="808"  MouseDown="UserControl_MouseDown">
    
    <Grid>
        <t:HelixView3D x:Name="view1" MouseDown="view1_MouseDown" MouseMove="view1_MouseMove">
            <t:DefaultLightsVisual3D/>
            <t:GridLinesVisual3D Center="-0.5,-0.5,-0.5" Width="20" Height="20" MinorDistance="1" MajorDistance="10" Thickness="0.04" Fill="Black"/>
            <ModelVisual3D Content="{Binding Model}"/>
        </t:HelixView3D>
        <DockPanel 
  Width="Auto" 
  VerticalAlignment="Stretch" 
  Height="Auto" 
  HorizontalAlignment="Stretch" 
  Grid.ColumnSpan="1" 
  Grid.Column="0" 
  Grid.Row="0" 
  Margin="0,0,0,0" 
  Grid.RowSpan="1">
            <StackPanel>
                <StackPanel.Background>
                    <LinearGradientBrush>
                        <GradientStop Color="White" Offset="0"/>
                        <GradientStop Color="DarkKhaki" Offset=".3"/>
                        <GradientStop Color="DarkKhaki" Offset=".7"/>
                        <GradientStop Color="White" Offset="1"/>
                    </LinearGradientBrush>
                </StackPanel.Background>
                <StackPanel Margin="10" Height="570" Orientation="Vertical">
                    <TextBlock Text="Camera X Position:"/>
                    <TextBox Name="cameraPositionXTextBox" MaxLength="5" 
   HorizontalAlignment="Left" Text="9"/>
                    <TextBlock Text="Camera Y Position:"/>
                    <TextBox Name="cameraPositionYTextBox" MaxLength="5" 
   HorizontalAlignment="Left" Text="8"/>
                    <TextBlock Text="Camera Z Position:"/>
                    <TextBox Name="cameraPositionZTextBox" MaxLength="5" 
   HorizontalAlignment="Left" Text="10"/>
                    <Separator/>
                    <TextBlock Text="Look Direction X:"/>
                    <TextBox Name="lookAtXTextBox" MaxLength="5" 
   HorizontalAlignment="Left" Text="-9"/>
                    <TextBlock Text="Look Direction Y:"/>
                    <TextBox Name="lookAtYTextBox" MaxLength="5" 
   HorizontalAlignment="Left" Text="-8"/>
                    <TextBlock Text="Look Direction Z:"/>
                    <TextBox Name="lookAtZTextBox" MaxLength="5" 
   HorizontalAlignment="Left" Text="-10"/>
                    <Separator/>
                    <Button 
     Name="triangleButton" 
     Click="simpleButtonClick" Content="Triangle" Margin="5"></Button>

                    <Button Name="cubeButton" Click="cubeButtonClick" Margin="5">Cube</Button>
                    <Button Content="Test Cube" Name="btnTestCube" Width="89" Click="btnTestCube_Click" />
                    <Label Content="Size:" Height="28" Name="label1" Width="37" />
                    <TextBox Height="23" Name="txtSize" Width="44" Margin="5" Text="3" />
                    <Label Content="X" Height="28" Name="label2" Width="37" />
                    <Slider Height="23" Name="sliderX" Width="100" Minimum="-10" ValueChanged="sliderX_ValueChanged" />
                    <Label Content="Y" Height="28" Name="label3" Width="37" />
                    <Slider Height="23" Minimum="-10" Name="sliderY" Width="100" ValueChanged="sliderY_ValueChanged" />
                    <Label Content="Z" Height="28" Name="label4" Width="37" />
                    <Slider Height="23" Minimum="-10" Name="sliderZ" Width="100" ValueChanged="sliderZ_ValueChanged" />
                </StackPanel>
            </StackPanel>
            <Viewport3D Name="mainViewport" ClipToBounds="True" MouseDown="mainViewport_MouseDown" Height="461">
                <Viewport3D.Camera>
                    <PerspectiveCamera 
	  FarPlaneDistance="100"
	  LookDirection="-11,-10,-9"
	  UpDirection="0,1,0"
	  NearPlaneDistance="1" 
	  Position="11,10,9" 
	  FieldOfView="70" />
                </Viewport3D.Camera>
                <ModelVisual3D>
                    <ModelVisual3D.Content>
                        <DirectionalLight 
	    Color="White" 
	    Direction="-2,-3,-1" />
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </Viewport3D>
        </DockPanel>
    </Grid>
</UserControl>
